#ifndef _DATA_PROCESSING_H_
#define _DATA_PROCESSING_H_

#include "../spanishFreq.h"          

/**
 * Computes the frequency of each letter in the string s.
 *
 * @param[out]	frequencies    The computed frequencies of each letter in s. The
 *                            array must be previously created.
 * @param[in]	size		      The size of the data.
 * @param[in]	s		         The data which frequencies are going to be
 *                            computted.
 *
 * @return	Lower than zero in case of error.
 */
int computeFrequencies (int *s, long size, alphabetArray *frequencies);

/**
 * Rotates de array.
 *
 * @param[in/out] frequencies The array to be rotated.
 *
 * @return	Lower than zero in case of error.
 */
//int rotateAlphabetArray (alphabetArray *frequencies);

/**
 * Computes the index of coincidence for a given set of frequencies.
 *
 * @param[in] frequencies The array of frequencies
 * @param[in] size        The size of the original message.
 *
 * @return	The index of coincidence.
 */
float computeIndexOfCoincidence (alphabetArray frequencies, int size);

/**
 * Retrieves the character with the highest frequency.
 *
 * @param[in] frequencies The array of frequencies
 *
 * @return	The character with the highest frequency.
 */
letterStat getMaxFreq (alphabetArray frequencies);

/**
 * Rotates the data and prints it.
 *
 * @param[in] s         The array of numbers representing the letters.
 * @param[in] size      The size fo the array.
 * @param[in] rotation  The rotation factor.
 */
void unRotateAndPrint(const int *s, long size, int rotation);

/**
 * Rotates the data.
 *
 * @param[in/out] s         The array of numbers representing the letters.
 * @param[in]     size      The size fo the array.
 * @param[in]   rotation    The rotation factor.
 */
void unRotate(int *s, long size, int rotation);

/**
 * Prints the data.
 *
 * @param[in/out] s         The array of numbers representing the letters.
 * @param[in]     size      The size fo the array.
 */
void printIntArray(int *s, long size);
#endif 
